<template>
	<view class="item-box">
		<image class="img-box" mode="scaleToFill" :src="commodityInfo.shop.shop_image">

<!--			<view class="discount-box">-->
<!--				{{commodityInfo.shop.discount}}折-->
<!--			</view>-->
		</image>
		<view class="content-box">
			<view class="title-box">
				{{commodityInfo.shop.shop_name || ''}}
			</view>
			<view class="tag-box">
				<view class="tag-item-box" v-for="(item,index) in commodityInfo.shop.shop_tags" :key='index'>
					{{item}}
				</view>
			</view>
			<view class="price-distance-box">
				{{commodityInfo.shop.shop_text}}
			</view>
			<view class="star-box">
				<u-rate v-model="commodityInfo.shop.shop_score" inactive-color='#E2DFDD'  active-color="#FE811C" :disabled="true"></u-rate>
			</view>
			<view class="coupon-box" v-if="commodityInfo.shop.quan_text">
				<view class="icon-box">券</view>
				<view class="coupon-content-box">
					{{commodityInfo.shop.quan_text}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "commodityItem",
		props: {
			commodityInfo: {
				type: Object,
				default: () => {
				  return {};
				}
			}
		},
		data() {
			return {

			};
		},
		mounted(){
		},
		methods:{

		}
	}
</script>

<style scoped lang='scss'>
	.item-box {
		width: 100%;
		height: 240rpx;
		padding: 20rpx;
		display: flex;
		background-color: #fff;
	}

	.img-box {
		width: 260rpx;
		height: 200rpx;
		background-color: #eeeeee;
		border-radius: 16rpx;
		position: relative;
	}
.discount-box{
	position: relative;
	left: -230rpx;
	top:150rpx;
	width: 74rpx;
	height: 36rpx;
	background: linear-gradient(270deg, #FF5251 0%, #FD8E8A 100%);
	box-shadow: 0rpx 4rpx 4rpx 2rpx rgba(214,53,53,0.3300);
	border-radius: 16rpx 0rpx;
	font-size: 10px;
	font-family: PingFang SC-Bold, PingFang SC;
	font-weight: bold;
	color: #FFFFFF;
	text-align: center;
	line-height: 36rpx;
}
	.content-box {
		margin-left: 18rpx;
		width: calc(100% - 270rpx);
		height: 200rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		.title-box{
			width: 100%;
			/* height: 40rpx; */
			line-height: 40rpx;
			font-size: 32rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #333333;
		}
		.tag-box{
			width: 100%;
			/* height:40rpx; */
			display: flex;
			align-items: center;
			.tag-item-box{
				width: 88rpx;
				height: 32rpx;
				font-size: 22rpx;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #FE811C;
				line-height: 32rpx;
				text-align: center;
				background: #FFF0E4;
				border-radius: 2px 2px 2px 2px;
				margin-right: 14rpx;
			}
		}
		.price-distance-box{
			width: 100%;
			height: 20rpx;
			font-size: 20rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #999999;
			/* line-height: 44rpx; */
			display: flex;
			align-items: center;
		}
		.star-box{
			width: 100%;
			/* height: 30rpx; */
			display: flex;
			align-items: center;
			margin-right: 8rpx;
			.star-item-box{
				width: 26rpx;
				height: 26rpx;
			}
		}
		.coupon-box{
			width: 100%;
			/* height: 46rpx; */
			display: flex;
			align-items: flex-end;
			.icon-box{
				width: 30rpx;
				height: 30rpx;
				background-color: #FC5351 ;
				font-size: 22rpx;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #fff;
				line-height: 30rpx;
				text-align: center;
			}
			.coupon-content-box{
				padding: 0rpx 10rpx;
				border-radius: 2px 2px 2px 2px;
				opacity: 1;
				border: 2rpx solid #FC5351;
				height: 30rpx;
				font-size: 20rpx;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #FC5351;
				display: flex;
				align-items: center;
			}
		}
	}
</style>
